// 先跟着官网教程走  https://nodejs.cn/en/learn   https://nodejs.cn/en/learn
// 公司电脑node版本 20.16.0

import { createServer } from 'node:http';

// https://nodejs.cn/api/v20/http.html#httpcreateserveroptions-requestlistener

const hostname = '127.0.0.1';
const port = 3000;

const server = createServer((req, res) => {
  res.statusCode = 200;
  res.setHeader('Content-Type', 'text/plain');
  res.end('Hello World');
});

server.listen(port, hostname, () => {
  console.log(`Server running at http://${hostname}:${port}/`);
  console.log(process.env.USER_ID);
});